export type ResultOption = {
  [key: string | number]: any;
};

export function formatOption(dataSource: any[], {label, value}: {label: string; value: string}): ResultOption[] {
  return dataSource.map((item: {[key: string]: any; label: string; value: string}) => {
    item.label = item[label];
    item.value = item[value];
    return item;
  });
}
